#include<bits/stdc++.h>
#include<cstdio>
using namespace std;

int n;
map<int,int > r;
int sum,out;

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        int a;
        cin>>a;
        r[a]++;
    }
    int now = 0;
    for(int i=1;;i++)
    {
        if(sum == n) break;
        if(now != 0)
        {
            if(r[i] > now) out += now,now = 0;
            if(r[i] <= now) now -= r[i],out += r[i];
        }
        now += r[i];
        sum += r[i];
    }
    cout<<n-out;
    return 0;
}
